﻿#ifndef _VECTOR_SPATIALINDEXPARAM_H_H_
#define _VECTOR_SPATIALINDEXPARAM_H_H_

#include "udatabase/dll_cfg.h"
#include "udatabase\interface\ifeatureclass2.h"


namespace FD{
	namespace Utility{
		namespace DB{

				/// <summary>
				/// 默认空间索引参数类
				/// </summary>
				class FD_DB_Export CRTreeSpatialIndexParam
									:public FD::Utility::DB::Interface::ISpatialIndexParam
				{
				public:
					/// <summary>
					/// 默认析构函数
					/// </summary>
					~CRTreeSpatialIndexParam();
					/// <summary>
					/// 默认构造函数
					/// </summary>
					CRTreeSpatialIndexParam();
					/// <summary>
					/// 将参数输出到流
					/// </summary>
					/// <param name="stream">输出参数，流</param>
					/// <returns></returns>
					void toStream( /*_out*/ FD::Kernel::DataStream & stream ) const;
					
					void fromStream( FD::Kernel::DataStream& stream );
				};

				class FD_DB_Export CSpatialGridIndexParam
									: public FD::Utility::DB::Interface::ISpatialIndexParam
				{
				public:
					CSpatialGridIndexParam();
					CSpatialGridIndexParam(const double gridOneSize,
															const double gridTwoSize,
															const double gridThreeSize);
					~CSpatialGridIndexParam() {}
					void setGridOneSize(const double gridSize);
					void setGridTwoSize(const double gridSize);
					void setGridThreeSize(const double gridSize);
					void getGridSize(double& gridOneSize, double& gridTwoSize, double& gridThreeSize) const;
					/// <summary>
					/// 将参数输出到流
					/// </summary>
					/// <param name="stream">输出参数，流</param>
					/// <returns></returns>
					void toStream( /*_out*/ FD::Kernel::DataStream & stream ) const;
					
					void fromStream( FD::Kernel::DataStream& stream );
					private:
					//CSpatialGridIndexParam(FD::GraphicEngine::NameValuePairList *pList);
				private:
					double m_gridOneSize;
					double m_gridTwoSize;
					double m_gridThreeSize;
				};
				class FD_DB_Export CSpatialIndexParamFactory
					:public FD::Kernel::CReferenced
				{
				public:
					/// <summary>
					/// 默认析构函数
					/// </summary>
					~CSpatialIndexParamFactory();
					/// <summary>
					/// 默认构造函数
					/// </summary>
					CSpatialIndexParamFactory();
					/// <summary>
					/// 将参数输出到流
					/// </summary>
					/// <param name="stream">输出参数，流</param>
					/// <returns></returns>
					virtual   FD::Utility::DB::Interface::ISpatialIndexParam* createSpatialIndexParam( FD::Utility::DB::Interface::SpatialIndexEnum type );
					/// <summary>
					/// 从流创建空间索引参数对象
					/// </summary>
					/// <param name="stream">输入参数，流</param>
					/// <returns></returns>
					virtual   FD::Utility::DB::Interface::ISpatialIndexParam* createSpatialIndexParam( FD::Kernel::DataStream& stream );
private:
					//CSpatialIndexParamFactory(FD::GraphicEngine::NameValuePairList *pList);
				};


}}} // End of Namespaces

#endif //_VECTOR_SPATIALINDEXPARAM_H_H_

